<?php

/**
 * VideoGroup form base class.
 *
 * @method VideoGroup getObject() Returns the current form's model object
 *
 * @package    iEasy
 * @subpackage form
 * @author     Your name here
 * @version    SVN: $Id: sfDoctrineFormGeneratedTemplate.php 29553 2010-05-20 14:33:00Z Kris.Wallsmith $
 */
abstract class BaseVideoGroupForm extends BaseFormDoctrine
{
  public function setup()
  {
    $this->setWidgets(array(
      'video_group_id' => new sfWidgetFormInputHidden(),
      'title'          => new sfWidgetFormTextarea(),
      'artist'         => new sfWidgetFormInputText(),
      'publish_time'   => new sfWidgetFormDateTime(),
      'create_time'    => new sfWidgetFormDateTime(),
      'modify_time'    => new sfWidgetFormDateTime(),
      'catalog_id'     => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Catalog'), 'add_empty' => true)),
      'sub_catalog_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Catalog_2'), 'add_empty' => true)),
      'tag'            => new sfWidgetFormTextarea(),
      'keyword'        => new sfWidgetFormTextarea(),
      'brief'          => new sfWidgetFormTextarea(),
      'source'         => new sfWidgetFormTextarea(),
      'status_id'      => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Status'), 'add_empty' => true)),
      'member_level_i' => new sfWidgetFormInputText(),
      'snapshot'       => new sfWidgetFormTextarea(),
      'is_audit_b'     => new sfWidgetFormInputText(),
      'brief_title'    => new sfWidgetFormTextarea(),
      'system_user_id' => new sfWidgetFormDoctrineChoice(array('model' => $this->getRelatedModelName('Systemuser'), 'add_empty' => true)),
    ));

    $this->setValidators(array(
      'video_group_id' => new sfValidatorChoice(array('choices' => array($this->getObject()->get('video_group_id')), 'empty_value' => $this->getObject()->get('video_group_id'), 'required' => false)),
      'title'          => new sfValidatorString(array('required' => false)),
      'artist'         => new sfValidatorString(array('max_length' => 50, 'required' => false)),
      'publish_time'   => new sfValidatorDateTime(array('required' => false)),
      'create_time'    => new sfValidatorDateTime(array('required' => false)),
      'modify_time'    => new sfValidatorDateTime(array('required' => false)),
      'catalog_id'     => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Catalog'), 'required' => false)),
      'sub_catalog_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Catalog_2'), 'required' => false)),
      'tag'            => new sfValidatorString(array('required' => false)),
      'keyword'        => new sfValidatorString(array('required' => false)),
      'brief'          => new sfValidatorString(array('required' => false)),
      'source'         => new sfValidatorString(array('required' => false)),
      'status_id'      => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Status'), 'required' => false)),
      'member_level_i' => new sfValidatorInteger(array('required' => false)),
      'snapshot'       => new sfValidatorString(array('required' => false)),
      'is_audit_b'     => new sfValidatorInteger(array('required' => false)),
      'brief_title'    => new sfValidatorString(array('required' => false)),
      'system_user_id' => new sfValidatorDoctrineChoice(array('model' => $this->getRelatedModelName('Systemuser'), 'required' => false)),
    ));

    $this->widgetSchema->setNameFormat('video_group[%s]');

    $this->errorSchema = new sfValidatorErrorSchema($this->validatorSchema);

    $this->setupInheritance();

    parent::setup();
  }

  public function getModelName()
  {
    return 'VideoGroup';
  }

}
